net: Use safe math macros to prevent overflows
authorLidong Chen <lidong.chen@oracle.com>
Wed, 22 Jan 2025 18:04:42 +0000 (18:04 +0000)
committerMiao Wang <shankerwangmiao@gmail.com>
Sun, 15 Feb 2026 13:50:20 +0000 (13:50 +0000)
commitfc2efa9fdb67f487d34b370c8c57c4a3cd50332b
tree91f62de47a993e31004bf430656c4fc106deb52c
parent53aa1c1ca25ddc8e5be1610e2769f4216d20aef6
net: Use safe math macros to prevent overflows

Replace direct arithmetic operations with macros from include/grub/safemath.h
to prevent potential overflow issues when calculating the memory sizes.

Signed-off-by: Lidong Chen <lidong.chen@oracle.com>
Signed-off-by: Alec Brown <alec.r.brown@oracle.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
Conflicts:
grub-core/net/bootp.c
grub-core/net/net.c

Gbp-Pq: Topic cve-2025-jan
Gbp-Pq: Name net-Use-safe-math-macros-to-prevent-overflows.patch
grub-core/net/bootp.c
grub-core/net/dns.c
grub-core/net/drivers/ieee1275/ofnet.c
grub-core/net/net.c